package com.wbc.smartHome.config;


import com.wbc.smartHome.Interceptor.UserTokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

@Configuration
public class WebConfig implements WebMvcConfigurer{
	/*配置拦截器*/
	public void addInterceptors(InterceptorRegistry registry) {
		//inter.addPathPatterns("/user/**"); //用户需要拦截过滤地址
		InterceptorRegistration interceptorRegistration = registry.addInterceptor(new UserTokenInterceptor());
		interceptorRegistration.addPathPatterns("/userApi/**");
		interceptorRegistration.excludePathPatterns("/userApi/userCtl/createYzm");
		interceptorRegistration.excludePathPatterns("/userApi/userCtl/regUser");
		interceptorRegistration.excludePathPatterns("/userApi/userCtl/loginUser");
		interceptorRegistration.excludePathPatterns("/userApi/userCtl/captcha");
	}
}
